﻿using System;
using System.Collections.Generic;

namespace Web.Model
{
	public class User : Entity
	{
		public string DisplayName { get; set; }

		public Password Password { get; set; }

		//[Required(ErrorMessage = "Пожалуйста, укажите e-mail")]
		
		public string Email { get; set; }

		public string NotificationEmail { get; set; }

        public bool HideEmail { get; set; }

		public string Contacts { get; set; }

		public string Skills { get; set; }

		public string Interests { get; set; }

		public Avatar Avatar { get; set; }

		public IList<Opinion> Opinions { get; set; }

		public int Stars { get; set; }

	    public bool IsAdmin { get; set; }

        public bool NotifyOrganizerProjectCommented { get; set; }
        
        public bool NotifyAuthorCommentReplied { get; set; }
        
        public bool NotifyParticipantProjectUpcoming { get; set; }

        public bool NotifyOrganizerUserApplied { get; set; }
        
        public bool NotifyParticipantApplicationApproved { get; set; }
        
        public bool NotifyOrganizerIdeaApproved { get; set; }

        public bool NotifyAuthorNewsCommented { get; set; }

        public int AccountSourceId { get; set; }

        public AccountSource AccountSource
        {
            get
            {
                return (AccountSource)AccountSourceId;
            }
            set
            {
                AccountSourceId = (int)value;
            }
        }
	}

	public class Opinion : Entity
	{
		public DateTime DateCreated { get; set; }

		public string Text { get; set; }

		public User Author { get; set; }
	}

    public enum AccountSource
    {
        GoodWorx = 0,
        Gmail = 1,
        Facebook = 2,
        Vkontakte = 3
    }
}